package com.arron.ssm.entity;

import com.arron.ssm.valided.AddGroup;
import com.arron.ssm.valided.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;

@Data
public class Employee {

    private Long id;

    private Integer age;

    @NotBlank(message = "员工姓名不能为空",groups = {AddGroup.class})
    @Pattern(regexp = "^[\\u4E00-\\u9FA5A-Za-z0-9]{3,10}$",message = "名字必须是3~10位中文,英文,数字",groups = {UpdateGroup.class, AddGroup.class})
    private String name;

    private Integer sex;

    private String address;
    private Integer version;

}